{include file="public/layout" /}
<body style="overflow: auto; cursor: default; -moz-user-select: inherit;background-color:#F4F4F4;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="shop/left" /}
<div id="geduan_div" class="h10"></div>
<div id="page_div" class="page min-hg-c mb-20" style="min-width: auto;box-shadow: none;">
    <div class="ncap-form-default flexigrid htitx pt0">
        <div class="fixed-bar">
            <div class="item-title">
                <a class="back_xin" href="javascript:history.back();" title="返回"><i class="iconfont e-fanhui"></i></a>
                <div class="subject"><h3>添加核销员</h3> <h5></h5></div>
            </div>
        </div>

        <form class="form-horizontal" id="postForm">
            <dl class="row">
                <dt class="tit"><label for="users_id"><em>*</em>用户名称</label></dt>
                <dd class="opt" id="userInfo">
                    <img style="float: unset; border: 1px solid #e9edef; width: 24px; height: 24px; border-radius: 50%;" src="{$info.head_pic|get_default_pic=###}">
                    <a href="javascript:void(0);" data-href="{:url('Member/users_edit',['id'=>$info.users_id])}" onclick="openFullframe(this, '会员资料','100%','100%');">{$info.nickname}</a>
                    <input type="hidden" name="users_id" id="users_id" value="{$info.users_id}">
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label for="points_id"><em>*</em>所属提货点</label></dt>
                <dd class="opt">
                    <!-- 列出提货点列表 -->
                    <select name="points_id" id="points_id">
                        {foreach name="$points_list" item="vo"}
                        <option value="{$vo.id}" {eq name="$info.points_id" value="$vo.id"} selected {/eq}>{$vo.title}</option>
                        {/foreach}
                    </select>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="name"><em>*</em>核销员名称</label>
                </dt>
                <dd class="opt">
                    <input id="name" name="name" value="{$info.name}" class="input-txt" type="text" autocomplete="off"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>手机号码</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="mobile" id="mobile" value="{$info.mobile}" class="input-txt" autocomplete="off"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label for="status">核销状态</label></dt>
                <dd class="opt">
                    <label class="curpoin"><input id="status0" name="status" value="0" type="radio" {empty name="$info.status"}checked="checked"{/empty}>开启</label>
                    &nbsp;
                    <label class="curpoin"><input id="status1" name="status" value="1" type="radio">关闭</label>
                </dd>
            </dl>
            <div class="ncap-form-default">
                <div class="bot2" style="left: 115px;">
                    <input type="hidden" name="id" value="{$info.id}">
                    <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green">确认提交</a>
                    <a class="ncap-btn-big ncap-btn-no" href="javascript:history.back();" title="返回">返回</a>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
    $(function() {
        try {
            if (typeof(eval('is_conceal_1649209614')) == "function" && is_conceal_1649209614()) {
                $(".page").css("margin-left", "");
            } else {
                $(".page").css("margin-left", "110px");
            }
        } catch (e) {
        }
    });

    function checkForm() {
        if ($('#users_id').val() == '') {
            showErrorMsg('请选择用户');
            return false;
        }
        if ($('#points_id').val() == '') {
            showErrorMsg('请选择所属提货点');
            return false;
        }
        if ($('#name').val() == '') {
            showErrorMsg('请输入核销员名称');
            $('#name').focus();
            return false;
        }
        if ($('#mobile').val() == '') {
            showErrorMsg('请输入手机号');
            $('#mobile').focus();
            return false;
        }
        layer_loading('正在处理');
        $.ajax({
            type: 'post',
            url: "{:url('OrderVerify/verifier_edit', ['_ajax'=>1])}",
            data: $('#postForm').serialize(),
            dataType: 'json',
            success: function (res) {
                layer.closeAll();
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function () {
                        window.location.href = res.url;
                    });
                } else {
                    showErrorMsg(res.msg);
                }
            },
            error: function (e) {
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        });
    }
</script>